package com.player;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class SessionServlet extends HttpServlet {

	@Override
	public void init() throws ServletException {
		super.init();
	}

	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
		resp.setContentType("text/html");

		// FIXME missing servlet mappings
		String reqURI = req.getRequestURI().toLowerCase();
		if (reqURI.endsWith("/account")) {

		} else if (reqURI.endsWith("/register")) {
			RequestDispatcher dispatcher = req.getRequestDispatcher("/register.jsp");
			dispatcher.forward(req, resp);
		} else {
			RequestDispatcher dispatcher = req.getRequestDispatcher("/main.jsp");
			dispatcher.forward(req, resp);
		}

	}

}
